<?php
/**
 * @link https://www.kancloud.cn/cleverstone/ymb2
 * @copyright Copyright (c) 2020 Yii Manager Software LLC
 */

use builder\base\BaseBundle;
use yii\helpers\Html;

BaseBundle::register($this);

/** @var \yii\web\View $this view组件实例 */
/** @var string $content 主体内容 */
/** @var string $uiTheme UI主题 */

$uiTheme = $this->params['uiTheme'];
$themeColor = $this->params['themeColor'];
?>
<?php $this->beginPage() ?>
<!DOCTYPE html>
<html lang="<?= Yii::$app->language ?>" class="h-100">
<head>
    <meta charset="<?= Yii::$app->charset ?>">
    <meta name="viewport" content="initial-scale=1.0, width=device-width, shrink-to-fit=no">
    <?php $this->registerCsrfMetaTags() ?>
    <?= \builder\helper\H5::registerBackendMetaTags() ?>
    <title><?= Html::encode($this->title) ?></title>
    <?php $this->head() ?>

    <!--Brand-->
    <script>
        !function () {
            let pad_char = function (count, char) {
                let str = '';
                for (let i = 0; i < count; i++) str += char;
                return str;
            };
            let $topLeftAngle = '╔';
            let $topRightAngle = '╗';
            let $bottomLeftAngle = '╚';
            let $bottomRightAngle = '╝';
            let $rowChar = '═';
            let $colChar = '║';
            let $space = '\u0020';
            let $crlf = '\r\n';
            let $brandName = 'Yii Manager 2.0';
            let $breakPoint = '%c';
            let $message = '';
            $message += $breakPoint + $topLeftAngle + pad_char(26, $rowChar) + $topRightAngle + $crlf;
            $message += $colChar + pad_char(3, $space) + $breakPoint + $brandName + $breakPoint + pad_char(3, $space) + $colChar + $crlf;
            $message += $colChar + pad_char(26, $space) + $colChar + $crlf;
            $message += $colChar + pad_char(2, $space) + '天之道，损有余而补不足' + pad_char(4, $space) + $colChar + $crlf;
            $message += $bottomLeftAngle + pad_char(26, $rowChar) + $bottomRightAngle;
            let $style1 = 'color:#d1d2d3;font-weight:700;font-size:12px;font-family:mono,consolas;';
            let $style2 = 'color:#00b6bf;font-weight:700;font-size:16px;font-family:mono,consolas;';
            let $style3 = 'color:#e0e1e2;font-weight:700;font-size:12px;font-family:mono,consolas;';

            console.log($message, $style1, $style2, $style3);
        }();
    </script>

    <!--css变量-->
    <style>
        :root {
            --primary-color: <?= $themeColor ?>;
        }
    </style>
</head>
<body class="<?= $uiTheme ?> d-flex flex-column h-100" ng-cloak ng-app="ym2.app">
<?php $this->beginBody() ?>

<main role="main">
    <?= $content ?>
</main>

<?php $this->endBody() ?>
</body>
</html>
<?php $this->endPage();
